<grr-check-client-access client-id="controller.clientId">

  <div ng-if="controller.clientId">

    <grr-debug-requests-view fetch-responses="0">
    </grr-debug-requests-view>

    <div class="pull-right padded">
      <div class="btn-group">
        <label class="btn btn-primary" ng-model="controller.duration" uib-btn-radio="60">1h</label>
        <label class="btn btn-primary" ng-model="controller.duration" uib-btn-radio="180">3h</label>
        <label class="btn btn-primary" ng-model="controller.duration" uib-btn-radio="360">6h</label>
        <label class="btn btn-primary" ng-model="controller.duration" uib-btn-radio="1440">1d</label>
        <label class="btn btn-primary" ng-model="controller.duration" uib-btn-radio="10080">7d</label>
        <label class="btn btn-primary" ng-model="controller.duration" uib-btn-radio="44640">31d</label>
      </div>
    </div>

    <div class="clearfix"></div>

    <div class="padded">

      <h4>Client CPU usage</h4>
      <grr-timeseries-graph title="Client CPU usage"
                            start-time="controller.startTime"
                            end-time="controller.endTime"
                            compute-delta="true">
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="User CPU seconds"
                                     metric="cpu_user">
        </grr-client-load-graph-serie>
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="System CPU seconds"
                                     metric="cpu_system">
        </grr-client-load-graph-serie>
      </grr-timeseries-graph>

      <h4>Client CPU load percentage</h4>
      <grr-timeseries-graph title="Client CPU load percentage"
                            start-time="controller.startTime"
                            end-time="controller.endTime">
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="CPU load percentage"
                                     metric="cpu_percent">
        </grr-client-load-graph-serie>
      </grr-timeseries-graph>

      <h4>Client IO usage</h4>
      <grr-timeseries-graph title="Client IO usage"
                            start-time="controller.startTime"
                            end-time="controller.endTime"
                            compute-delta="true">
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="Bytes read"
                                     metric="io_read_bytes">
        </grr-client-load-graph-serie>
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="Bytes written"
                                     metric="io_write_bytes">
        </grr-client-load-graph-serie>
      </grr-timeseries-graph>

      <h4>Client IO operations count</h4>
      <grr-timeseries-graph title="Client IO operations"
                            start-time="controller.startTime"
                            end-time="controller.endTime"
                            compute-delta="true">
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="Read operations count"
                                     metric="io_read_ops">
        </grr-client-load-graph-serie>
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="Write operations count"
                                     metric="io_write_ops">
        </grr-client-load-graph-serie>
      </grr-timeseries-graph>

      <h4>Client memory usage percentage</h4>
      <grr-timeseries-graph title="Client memory usage percentage"
                            start-time="controller.startTime"
                            end-time="controller.endTime">
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="Memory usage percentage"
                                     metric="memory_percent">
        </grr-client-load-graph-serie>
      </grr-timeseries-graph>

      <h4>Client RSS/VMS sizes</h4>
      <grr-timeseries-graph title="Client RSS/VMS sizes"
                            start-time="controller.startTime"
                            end-time="controller.endTime">
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="RSS size"
                                     metric="memory_rss_size">
        </grr-client-load-graph-serie>
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="VMS size"
                                     metric="memory_vms_size">
        </grr-client-load-graph-serie>
      </grr-timeseries-graph>

      <h4>Client network usage</h4>
      <grr-timeseries-graph title="Client network usage"
                            start-time="controller.startTime"
                            end-time="controller.endTime"
                            compute-delta="true">
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="Bytes received"
                                     metric="network_bytes_received">
        </grr-client-load-graph-serie>
        <grr-client-load-graph-serie client-id="controller.clientId"
                                     label="Bytes sent"
                                     metric="network_bytes_sent">
        </grr-client-load-graph-serie>
      </grr-timeseries-graph>

    </div>

  </div>

</grr-check-client-access>
